package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackStat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TrackStatMapper extends BaseMapper<TrackStat> {


    /**
     * @author WeakMoon
     * @date 2025/03/04 20:13:09
     * 更新声音播放量
     */
    @Update("update track_stat stat set stat_num = stat_num + #{count} where track_id = ${trackId} and  stat_type = #{type} and is_deleted = 0")
    void updateTrackStat(@Param("count") Integer count, @Param("trackId") Long trackId, @Param("type") String type);
}
